-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTFE Machine: do not expose Allocation #85472
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
It would be fairly easy to write a lint that ensures that there are no Allocations in public parts of memory.rs or in the Machine trait. Is this something you think could be useful? |
I guess? Honestly I am not sure if it's worth it, it's also not that hard to audit this manually.^^ What I am much more worried about is code inside |
OK, no lint then. About the raw functions. They could return a wrapper type that requires you to properly do checks before getting access to things. Not sure if that is possible in all cases, but we could always have the checks return token types that the actual access consumes, paired with long-named constructors for these token types so you can |
Anyway, this PR is good @bors r+ rollup |
📌 Commit 50a9f00 has been approved by |
We already have those wrapper types, they are called |
CTFE Machine: do not expose Allocation `Memory` is careful now to not expose direct access to `Allocation`, but this one slipped through. r? `@oli-obk`
Rollup of 8 pull requests Successful merges: - rust-lang#84717 (impl FromStr for proc_macro::Literal) - rust-lang#85169 (Add method-toggle to <details> for methods) - rust-lang#85287 (Expose `Concurrent` (private type in public i'face)) - rust-lang#85315 (adding time complexity for partition_in_place iter method) - rust-lang#85439 (Add diagnostic item to `CStr`) - rust-lang#85464 (Fix UB in documented example for `ptr::swap`) - rust-lang#85470 (Fix invalid CSS rules for a:hover) - rust-lang#85472 (CTFE Machine: do not expose Allocation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…-obk CTFE engine: small cleanups I noticed these while preparing a large PR, and figured I'd better send them ahead to not muddy the diff unnecessarily. - remove remaining use of Pointer in Allocation API (I missed those in rust-lang#85472) - remove unnecessary deallocate_local hack (this logic does not seem necessary any more) r? `@oli-obk`
Memory
is careful now to not expose direct access toAllocation
, but this one slipped through.r? @oli-obk